<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="icon" href="img/favicon.ico">
    <title>雷谛科技-3X净水计划</title>

    <link href="{{ URL::asset('front/css/bootstrap.min.css') }}" rel="stylesheet">
      <link rel="stylesheet" href="{{ URL::asset('front/fonts/font-awesome.min.css') }}">
    <link href="{{ URL::asset('front/css/extra.css') }}" rel="stylesheet">
<style>
.free1{
  padding-top: 10px;
}
.free1 p{
  color: #8b8b8b;
  font-size: 29px;
  padding:6px 0;
  margin-bottom:0px;
  font-family: "Microsoft Yahei";
}
.free1 cite{
  font-style: normal;
  color: #8b8b8b;
  font-size: 16px;
  line-height: 24px;
}
.free1 ul li{
  color: #609ee8;
  line-height: 28px;
  background: url({{ URL::asset('front/img/plus.jpg') }}) no-repeat left center;
  padding-left:20px;
  font-size: 16px;
}
</style>
  </head>

  <body style="padding-top: 0;padding-bottom: 10px;">
<div class="header">
    <img src="{{ URL::asset('front/img/3x-top.jpg?v=1') }}" class="img-responsive" width="100%" />
</div>
<div class="container">
    <div class="free1">
      <p>试用30天，效果说话</p>
      <cite>卖长期稳定的水质改善效果，有任何水质问题无条件解决！</cite>
      <ul>
        <li>净化效果不满意退货 </li>
        <li>价格和服务没优势退货</li>
        <li>家人不喜欢退货</li>
      </ul>
    </div>
    {{--<form action="/index.php/dy/weixin_form_product_info" method="post" id="pipe_form">--}}
    {{ Form::open(array('route' => 'mounts.store','files'=>true,'id'=>'pages')) }}
    <div class="title"><h3>申请试用<small>仅限开通区域装机</small></h3></div>
        <input type="hidden" name="type" value="1">
        <div class="row">
            <div class="form-group">
                @foreach($machines as $machine)
{{--                <option value="{{ $machine->id }}">{{ $machine->name }}</option>--}}
                <input type="hidden" id="price_{{ $machine->id }}" value="{{ $machine->price }}">
                @endforeach
                @foreach($prices as $price)
{{--                <option value="{{ $machine->id }}">{{ $machine->name }}</option>--}}
                <input type="hidden" id="filter_{{ $price->machine_id }}" value="{{ $price->price }}">
                @endforeach


                <div class="col-sm-10">
                  <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="headingOne">
                      <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                          选择机型
                        </a>
                      </h4>
                    </div>
                    <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                      <ul class="list-group">
                      @foreach($machines as $key => $machine)
                        <li class="list-group-item"><span class="label pull-right"><input @if($key == 0)checked @endif onclick="select_machine({{ $machine->id }})" type="radio" name="machine" id="" value="{{ $machine->id }}"></span>{{ $machine->name }}</li>
                        @endforeach
                        </ul>
                    </div>
                  </div>
                </div>
            </div>
        </div>

        <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                  <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="headingOne">
                      <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                          试用满意后，享受如下套餐价格:
                        </a>
                      </h4>
                    </div>
                    <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                      <ul class="list-group">
                        <li class="list-group-item"><span class="label label-success pull-right">完全免费赠送</span>主机价格：<i class="fa fa-cny"></i><s id="show_price">5680</s></li>
                        <li class="list-group-item">滤芯价格：<i class="fa fa-cny"></i><span id="show_filter">{{ $thisprice }}</span></li>
                        <li class="list-group-item">服务费用：<i class="fa fa-cny"></i>{{ $fuwufei }}</li>
                      </ul>
                      <div class="panel-footer">仅限开通3X计划的城市区域申请</div>
                    </div>
                  </div>
                  <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="headingTwo">
                      <h4 class="panel-title"><label  class="pull-right"><input type="checkbox" checked name="agreement"> 已阅并同意</label>
                        <a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
                          服务条款</a>
                      </h4>
                    </div>
                    <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
                        <div class="panel-body" style="display: none" id="heyue1">
                            <p>1、需方申请加入供方“健康用水解决方案”合约（以下简称合约）：需方只要签署“合约”，供方就提供一台全国统一零售价为198元/台生活净水宝（PP-1）。
                            <p>2、本产品适用于自来水前置过滤，可过滤自来水中的泥沙、铁锈、大分子颗粒物质，适用于洗脸、洗澡、洗菜、洗碗生活清洁等，不建议客户直接饮用。</p>
                            <p>3、赠送机器要求必须为本社区业主，且在本社区内安装，自领取产品后一周以内安装完毕，否则公司有权收回所赠机器。</p>
                            <p>4、本公司提供上门安装，费用为40元/台，对于签订安装协议且微信扫码客户、朋友圈分享可以免收安装费.
                            <p>5、对安装生活净水宝（PP-1）的客户后期滤芯更换采取自愿原则，但公司有义务每三个月提醒安装客户更换滤芯（滤芯每3个月更换一次，每只滤芯30元）。</p>
                            <p>6、本合约在产品安装后，则视合约生效。</p>

                        </div>
                        <div class="panel-body" style="display: none;" id="heyue2">
                            <p>1、需方申请加入供方“健康饮水解决方案”合约（以下简称合约）：需方只要签署“合约”，供方就提供一台所选净水机（只要连接自来水源就可以将自来水净化成国际直饮标准的净水器，以下简称净水器）让需方免费试用30天（指产品安装完毕之日起计算）。</p>
                            <p>2、试用期内，产品的所有权归供方所有，需方如对净水器的使用效果不满意，供方随时上门拆机、退回。</p>
                            <p>3、试用期内，因人为原因或私自移机，从而造成净水器损坏，须按价赔偿，因此发生漏水导致的各项损失由需方承担。</p>
                            <p>4、本试用条款，只针对杭州市内自有住房且自己居住的家庭。
                            <p>5、本合约在产品安装后，则视合约生效。</p>

                        </div>
                        <div class="panel-body" id="heyue">
                            <p>1、需方申请加入供方“健康饮水解决方案”合约（以下简称合约）：需方只要签署“合约”，供方就提供一台所选净水机（只要连接自来水源就可以将自来水净化成国际直饮标准的净水器，以下简称净水器）让需方免费试用30天（指产品安装完毕之日起计算）。</p>
                            <p>2、试用期内，产品的所有权归供方所有，需方如对净水器的使用效果不满意，供方随时上门拆机、退回。</p>
                            <p>3、试用期内，因人为原因或私自移机，从而造成净水器损坏，须按价赔偿，因此发生漏水导致的各项损失由需方承担。</p>
                            <p>4、本试用条款，只针对杭州市内自有住房且自己居住的家庭。
                            <p>5、本合约在产品安装后，则视合约生效。</p>

                        </div>
                    </div>
                  </div>
                </div>

        <div class="row">
            <div class="form-group">
                <label class="col-sm-2 control-label">联系人信息</label>
                <div class="col-sm-10">
                  <div class="input-group">
                  <span class="input-group-addon"><i class="fa fa-user"></i></span>
                  <input type="text" name="name" value="{{ $customer->name }}"  class="form-control" placeholder="联系人姓名">
                  </div>
                </div>
            </div>
        </div>

        <div class="input-group mg-t5">
        <label class="radio-inline">
          <input type="radio" name="sex" required id="inlineRadio1" value="1"> 男士
        </label>
        <label class="radio-inline">
          <input type="radio" name="sex" required id="inlineRadio2" value="2"> 女士
        </label>
        </div>
        <input type="hidden" name="area_id" id="area_id" value="">
        <div class="input-group mg-t5">
          <span class="input-group-addon"><i class="fa fa-map-marker fa-lg"></i></span>
          <input id="area" type="text" name="area_name" class="form-control" placeholder="输入完整小区名，或根据提示选择"   onkeyup="javascript:checkWord(this);" onmousedown="javascript:checkWord(this);" >
          <ul id="lookup" style="display: none;">
          </ul>
        </div>


        <div class="input-group mg-t5">
          <span class="input-group-addon"><i class="fa fa-home"></i></span>
          <input type="text" class="form-control"  name="address" placeholder="幢/单元/门牌号">
        </div>



        <div class="input-group mg-t5">
          <span class="input-group-addon"><i class="fa fa-mobile-phone fa-lg"></i>&nbsp;</span>
          <input type="text" class="form-control" value="{{ $customer->mobile }}" name="mobile" placeholder="电话">
        </div>

        <div class="row mg-t5">
            <div class="form-group">
                <label class="col-sm-2 control-label">期望上门时间</label>
                <div class="col-sm-10">
                  <div class="input-group">
                  <label class="radio-inline">
                    <input type="radio" name="time[]" required id="inlineRadio5" value="下班后"> 下班后
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="time[]" required id="inlineRadio7" value="周末"> 周末
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="time[]" required id="inlineRadio8" value="不限"> 不限
                  </label>
                  </div>
                </div>
            </div>
        </div>

        <hr/>
            <a href="javascript:void (0);" onclick="sub();"><button type="button" class="btn btn-info col-xs-12 col-md-12">提交申请</button></a>

{{ Form::close() }}

</div>


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="{{ URL::asset('front/js/jquery.min.js') }}"></script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('front/js/jquery.validate.min.js') }}"></script>
    <script src="{{ URL::asset('front/js/bootstrap.min.js') }}"></script>
    <script>
    function checkWord(obj){
        var content =  $(obj).val();
        $.post('{{ route('mounts.ajax') }}',{ content:content },function(data){
            if(data == 'no'){
                $('#lookup').hide();
            }else{
                $('#lookup').show();
                $('#lookup').html(data);
            }
        })
    }

    function setit(id,name){
        $('#area_id').val(id);
        $('#area').val(name);
                $('#lookup').hide();
    }

    function select_machine(id){
       var price = $('#price_'+id).val();
       var filter = $('#filter_'+id).val();
        var html;
        var heyue = $('#heyue');
       $('#show_price').html(price);
       $('#show_filter').html(filter);
        if(id == 11){
            html = $('#heyue1').html();
        }else{
            html = $('#heyue2').html();
        }
        heyue.html(html);
    }

     $(function(){

            $("#pages").validate({
                rules: {
                    machine: "required",
                    name: "required",
                    sex: "required",
                    address: "required",
                    mobile: "required",
                    time: "required"
                },
                messages: {
                    machine: "",
                    name: "",
                    sex: "",
                    address: "",
                    mobile: "",
                    time: ""
                }
            });
        });
    function sub(){
        $('#pages').submit();
    }
    </script>

  </body>
</html>